/*
 * Alexey Danchuk
 * This software is an implementation of the task from OOP module.
 */

/**
 * This class describes basics issues about our presentation of question.
 *
 * @version 1.01 30 January 2013
 * @author Alexey Danchuk
 *
 */

abstract class Question {
	/**
	 * This variable holds question text.
	 */
	private String question;

	/**
	 * This variable holds answers array.
	 */
	private String[] variantsAnswers;

	protected Question(String inQuestion, String[] inAnswers) {
		inputQuestion(inQuestion);
		inputAnswers(inAnswers);
	}

	/**
	 * Method to check answers with special algorithm
	 * which is different for our questions type.
	 *
	 * @param userAnswers - inputed answers from user
	 * @return - plus one point to the overall user mark
	 */
	protected abstract int chekAnswer(String[] userAnswers);

	protected abstract void saveAnswer(String[] answers);

	public final String[] getAnswerChoices() {
		return variantsAnswers;
	}

	public final String outQuestionText() {
		return question;
	}

	private final void inputQuestion(String questionText) {
		question = questionText;
	}

	private final void inputAnswers(String[] answersText) {
		variantsAnswers = answersText;
	}
}
